package com.huaxin.device.dto.request;

import com.huaxin.hxenum.validation.ValidEquipmentDataType;
import com.huaxin.hxenum.validation.ValidUnit;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
public class EquipmentDataSourceCreateReqDTO {

    @Schema(description = "采集设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "di123e456-789a-bcde-f012-3456789abcde")
    @NotBlank(message = "采集设备ID不能为空")
    private String collectorId;

    @Schema(description = "被采集的电力设备ID", example = "eq123e456-789a-bcde-f012-3456789abcdf")
    private String equipmentId;

    @Schema(description = "被采集的配电房ID", example = "rm123e456-789a-bcde-f012-3456789abcde")
    private String roomId;

    @Schema(description = "被采集的变电箱ID", example = "cb123e456-789a-bcde-f012-3456789abcdf")
    private String cabinetId;

    @Schema(description = "被采集的电井ID", example = "wl123e456-789a-bcde-f012-3456789abcde")
    private String wellId;

    @Schema(description = "数据类型：CURRENT, VOLTAGE, POWER 等", requiredMode = Schema.RequiredMode.REQUIRED, example = "CURRENT")
    @NotBlank(message = "数据类型不能为空")
    @ValidEquipmentDataType
    private String dataType;

    @Schema(description = "数据项名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "A相电流")
    @NotBlank(message = "数据项名称不能为空")
    private String dataName;

    @Schema(description = "是否为主展示数据", example = "true")
    @NotNull(message = "是否为主展示数据不能为空")
    private Boolean isPrimary;

    @Schema(description = "排序号", example = "10")
    private Integer sortOrder;

    @Schema(description = "单位", example = "A")
    @ValidUnit
    private String unit;

    @Schema(description = "采集间隔（秒）", example = "30")
    private Integer collectionInterval;

    @Schema(description = "备注")
    private String description;

    @Schema(description = "组织ID", example = "org123e456-789a-bcde-f012-3456789abcde")
    private String OrgId;

    @Schema(description = "家庭ID", example = "fam123e456-789a-bcde-f012-3456789abcde")
    private String familyId;
}